#include "mystdio.h"
#include <string.h>
#include <unistd.h>

const char* filename = "./log.txt";

int main()
{
    myfile* fp = myfopen(filename,"w");
    if(fp == NULL) return -1;

    int cnt = 5;
    char buffer[64];
    while(cnt)
    {
        snprintf(buffer,sizeof(buffer),"Linying have a parttime job this summer.%d ",cnt--);
        //snprintf(buffer,sizeof(buffer),"Linying good %d ",cnt--);
        my_fwrite(fp,buffer,strlen(buffer));
        DebugPrint(fp);
        sleep(1);
    }
    //fork();
    my_fclose(fp);
    return 0;
}
 
